package com.tzh.Advice;

import com.tzh.config.exception.CommonException;
import com.tzh.utils.ResultDto;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class CommenExceptionAdvice {

    @ExceptionHandler
    public ResultDto<?> returnError(CommonException ex) {
        return ResultDto.setFail(ex.getMessage());
    }
}
